package com.dongdongshop.controller;

import com.dk.data.R;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.service.TbcontentService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("tbcont")
public class TbcontentController {



    @DubboReference
    TbcontentService ts;


    //轮播图查询
    @RequestMapping("getlun")
    @ResponseBody
    public R<List<TbContent>> getlun(Long id){
        List<TbContent> ls = ts.getlun(id);
        return R.ok().setData(ls);
    }


    //今日推荐
    @RequestMapping("gettui")
    @ResponseBody
    public R<List<TbContent>> gettui(Long id){
        List<TbContent> ls = ts.gettui(id);
        return R.ok().setData(ls);
    }

    //猜你喜欢
    @RequestMapping("getlike")
    @ResponseBody
    public R<List<TbContent>> getlike(Long id){
        List<TbContent> ls = ts.getlike(id);
        return R.ok().setData(ls);
    }


}
